#! /usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from src.Queue import queue


def callback_cycle(future):
    tasks = future.result()
    tasks.status = False
    if tasks.cycle == '0':
        msg = 'tasks has Done'
        logging.info(msg)
    else:
        queue.put_nowait(tasks)
        msg = 'tasks has Cycle <<<<>>>> queue size ===:{}'.format(queue.qsize())
        logging.info(msg)